<%--
  Created by IntelliJ IDEA.
  User: gaopeng
  Date: 2021/7/8
  Time: 23:29
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <title>商品列表</title>
</head>
<body>
    <div class="container" style="width: 100%">

        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>
                        <small>商品列表 —— 显示所有商品</small>
                    </h1>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}">新增</a>
            </div>
        </div>

        <div class="row clearfix">
            <div class="col-md-12 column">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>商品编号</th>
                        <th>商品名字</th>
                        <th>市场价格</th>
                        <th>商品价格</th>
                        <%--<th>图片地址</th>--%>
                        <th>上架时间</th>
                        <th>是否热门</th>
                        <%--<th>商品描述</th>--%>
                        <th>商品标志</th>
                        <th>商品分类</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody>
                    <c:forEach var="product" items="${requestScope.get('productList')}">
                        <tr>
                            <td>${product.getPid()}</td>
                            <td>${product.getPname()}</td>
                            <td>${product.getMarket_price()}</td>
                            <td>${product.getShop_price()}</td>
                            <%--<td>${product.getPimage()}</td>--%>
                            <td>${product.getPdate()}</td>
                            <td>${product.getIs_hot()}</td>
                            <%--<td>${product.getPdesc()}</td>--%>
                            <td>${product.getPflag()}</td>
                            <td>${product.getCid()}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}">更改</a> |
                                <a href="${pageContext.request.contextPath}">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <div>${pageTool}</div>
            </div>
        </div>
    </div>
    <jsp:include page="frameFooter.jsp"/>
</body>
</html>
